<header class="header fixed clearfix navbar navbar-fixed-top">
	<div class="container">
		<div class="row">
			<div class="col-md-8">
				<div class="header-right clearfix">
					<div class="main-navigation animated">
						<nav class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation">
						    <div class="container-fluid">
						        <div class="navbar-header">
						            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
						            	<span class="sr-only">切换导航</span>
						                <span class="icon-bar"></span>
						                <span class="icon-bar"></span>
						                <span class="icon-bar"></span>
						            </button>
						            <a class="navbar-brand glyphicon" href="__ROOT__/home/Blast/blast">PIM</a>
						        </div>


						        <!-- Items -->
						        <div class="collapse navbar-collapse scrollspy smooth-scroll" id="topNavBar">
						            <ul class="nav navbar-nav navbar-right">
										<li><a href="__ROOT__/home/Blast/blast">&nbsp; Search</a></li>
					                	<li><a href="__ROOT__/home/Browse/browse">&nbsp; Browse</a></li>
										
										<li><a href="__ROOT__/home/Blast/goblast">&nbsp; Blast</a></li>
										<li><a href="__ROOT__/home/Download/downloadPage">&nbsp; Downloads</a></li>
					                	<li><a data-toggle="modal" data-target="#Modal" role="button">&nbsp; Login</a></li>
					                	
						            </ul>
						        </div>
						    </div>
						</nav>
					</div>
				</div>
			</div>
		</div>
	</div>
</header>


<!-- login -->
<div class="modal fade" id="Modal" role="dialog">
	<div style="display:table; width:100%; height: 100%">
		<div style="vertical-align: middle;display: table-cell;">
			<div class="modal-dialog modal-sm" style="width:313px;">
				<div class="modal-content" id="modal-login" data-whatever="login">
					<div class="modal-header">
						<button type="button" id="login_close" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" id="loginModalLabel" style="font-size: 18px;color: #000;">登录</h4>
					</div>

					<div class="modal-body">
						<section class="box-login v5-input-txt" id="box-login">

							<form id="login-form" method="POST" action="__ROOT__/home/Login/login" >
								<ul>
									<li class="form-group lg-font ">User: 
										<input class="form-control" id="login-user" maxlength="50" name="username" placeholder="请输入邮箱账号/手机号" type="text" onfocus="focusOn(this)" onblur="focusOff(this)">
										<div class="error-tips error-user" style="display:none;">用户名不可以为空</div>
									</li>
									<li class="form-group lg-font">Password: 
										<input class="form-control" id="login-password" name="password" placeholder="请输入密码" type="password" onfocus="focusOn(this)" onblur="focusOff(this)" onkeydown="keyOnLogin(event)">
										<div class="error-tips error-password" style="display:none;">密码不可以为空</div>
									</li>
									<input class="form-control" style="display:none;" id="url" name="url" value="">
								</ul>
							</form>

							<p class="small-font">
								<a style="color: red;" class="fr">忘记密码？</a>还没有账号？
								<a href="javascript:turnToRegister();" style="color: #ff7800;">立即注册</a>
							</p>

							

							<div>
								<button id="login-btn" type="button" class="btn btn-micv5 btn-block globalLogin" onclick="submitLogin()">登录</button>
							</div>
	
						</section>
					</div>
				</div>

				<!-- register -->
				<div class="modal-content" style="border:none;height:600px;display: none;" id="modal-register" data-whateber="register">
					<div class="modal-header">
						<button type="button" id="login_close" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" id="loginModalLabel" style="font-size: 18px;color: #000;">注册</h4>

					</div>

					<div class="modal-body">
						<span class="small-font" style="float:right;color: red"> * 为必填项</span>
						<form id="register-form" action="__ROOT__/home/Register/register" method="post" autocomplete="off">
							<ul>
								<li class="form-group lg-font"><span class="required">*</span>User: 
									<input class="form-control" id="register-user" maxlength="50" name="username" placeholder="请输入用户名" type="text" onfocus="focusOn(this)" onblur="usernameCheck(this)" required>
									<div class="error-tips error-user" style="display:none;"></div>
								</li>
								<li class="form-group lg-font"><span class="required">*</span>Password: 
									<input class="form-control" id="register-password" name="password" placeholder="请输入密码" type="password" onfocus="focusOn(this)" onblur="passwordCheck(this)" required>
									<div class="error-tips error-password" style="display:none;">密码不可以为空</div>
								</li>
								<li class="form-group lg-font"><span class="required">*</span>Password: 
									<input class="form-control" id="register-repassword" name="repassword" placeholder="请再次输入密码" type="password" onfocus="focusOn(this)" onblur="repasswordCheck(this)" onkeydown="keyOnRegister(event)" required>
									<div class="error-tips error-repassword" style="display:none;"></div>
								</li>
								<li class="form-group lg-font">Email: 
									<input class="form-control" id="register-email" name="email" placeholder="请输入邮箱" type="text" onfocus="focusOn(this)" onblur="emailCheck(this)">
									<div class="error-tips error-email" style="display:none;"></div>
								</li>
								<li class="form-group lg-font">PhoneNumber: 
									<input class="form-control" id="register-mobile" name="mobile" placeholder="请输入手机号码" type="text" onfocus="focusOn(this)" onblur="mobileCheck(this)">
									<div class="error-tips error-mobile" style="display:none;"></div>
								</li>
								<li class="form-group small-font ">
									<label style="float:left;">
										<input id="register-agree" type="checkbox" name="agree" onclick="agreeCheck(this)"> 我同意 <a href="#">网站安全协议</a>
									</label>
								</li>
							</ul>
						</form>

						
						<p style="padding: 6.5px;">
							<span class="small-font" style="float:right;">已有账号?<a href="javascript:turnToLogin();" style="color: #ff7800;">立即登录</a></span>
						</p>	

						<div style="margin-top: 20px;">
							<button id="register-btn" type="button" class="btn btn-micv5 btn-block globalLogin" onclick="submitRegister()" disabled="disabled">点击注册</button>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>
		<include file="Public:script" />


<script>
	$('#Modal').on('show.bs.modal', function() {
		var div = $('#login-form').find('div');
		div.attr('style', 'display:none');
		var input = $('#login-form').find('input');
		input.css('border-color', '#ccc')
	})
	$(function() {		
    	var whichTag = {$whichTag};
    	// console.log($('.navbar-nav li:eq(0)'));
		$('.navbar-nav li:eq(' + whichTag + ')').addClass('active');
	});
</script>